 <div class="row-fluid">
	<div class="span12">
	    <div class="head">
	        <div class="isw-picture"></div>
	        <h1><?php echo $this->pageTitle; ?></h1>
			<button class="btn btn-success btn-addSlide" type="button" style="float:right;margin:4px;">Thêm mới slide</button>
	        <div class="clear"></div>
	    </div>
	    <div class="block thumbs">
			<?php if(!empty($model)) foreach($model as $item):?>
				<div class="thumbnail">
		            <a class="fancybox" rel="group" href="<?php echo Yii::app()->baseUrl; ?>/upload/slides/<?php echo $item->image;?>"><img style="width: 200px;height: 135px;" src="<?php echo Yii::app()->baseUrl.'/upload/image.php?width=200&image='.Yii::app()->baseUrl.'/upload/slides/'.$item->image; ?>" class="img-polaroid"/></a>
		            <div class="caption row-form">
						<form enctype="multipart/form-data" method="POST" enctype="multipart/form-data" action="<?php echo PIUrl::createUrl('/admincp/systemInfo/updateSlideHome',array('id'=>$item->id));?>">
		                <h3><input type="file" name="HomeSlides[image]" /></h3>
		                <h3><input placeholder="Thứ tự hiển thị" type="text" name="HomeSlides[title]" value="<?php echo $item->title;?>" /></h3>
		                <h3><input placeholder="Liên kết hình" type="text" name="HomeSlides[link]" value="<?php echo $item->link;?>" /></h3>
		                <p><input type="submit" class="btn btn-warning" value="Cập nhật" /> <a class="btn" href="<?php echo PIUrl::createUrl('/admincp/systemInfo/deleteSlideHome',array('id'=>$item->id));?>">Xóa</a></p>
		            	</form>
					</div>
		        </div>
			<?php endforeach;?>
		<div class="clear"></div>
	    </div>
	</div>
</div>
<script>
$(document).ready(function(){
	$(".btn-addSlide").click(function(){
		var action = '<?php echo PIUrl::createUrl("/admincp/systemInfo/slideHome");?>';
		var html =  '<div class="thumbnail thumbnail-new">';
			html += '<a class="fancybox" rel="group" href="<?php echo Yii::app()->theme->baseUrl; ?>/img/example.jpg"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/example.jpg" class="img-polaroid"/></a>';
			html += '<div class="caption row-form">';
			html += '<form enctype="multipart/form-data" method="POST" enctype="multipart/form-data" action="">';
			html += '<h3><input type="file" name="HomeSlides[image]" /></h3>';
			html += '<h3><input placeholder="Thứ tự hiển thị" type="text" name="HomeSlides[title]" value="" /></h3>';
			html += '<h3><input placeholder="Liên kết hình" type="text" name="HomeSlides[link]" value="" /></h3>';
			html += '<p><input type="submit" class="btn btn-warning" value="Thêm mới" /> <a class="btn btn-delete-slide" href="javascript:void(0)">Xóa</a></p></form></div></div>';
		if($(".thumbnail-new").length >=1){
			alert('Lưu cho xong đi đã bạn ^^. Ham hố...');
			return false;
		}
		
		$(html).prependTo('.thumbs');
		$(".row-form,.dialog,.loginBox,.block-fluid").find("input:checkbox, input:radio, input:file").not(".skip").uniform();
	});
	
	$(".btn-delete-slide").live('click',function(){
		$(this).parent().parent().parent().parent().remove();
	});
});
</script>